using System;
using UnityEngine;

public class Globals : MonoBehaviour
{
	private static Globals _instance;

	public bool debugRun;

	public int applicationId = 21;

	[Space(10f)]
	public int startMoney;

	public int hintPrice;

	[NonSerialized]
	[HideInInspector]
	public int coinsOnCorrectAnswer = 1;

	public int crossWordCoinsOnCorrectAnswer = 1;

	public int wordSeekCoinsOnCorrectAnswer = 3;

	public int coinOnLevelFinished = 10;

	public int questionHintLockLevel = 20;

	[Space(10f)]
	//public string privacyPolicyLink = "http://simplicitygames.pl/MTMPrivacyPolicy/policy.html";

	[Space(10f)]
	//public string ourGamesLink_Android = "https://play.google.com/store/apps/developer?id=Simplicity+Games";

	//public string ourGamesLink_IOS = "https://play.google.com/store/apps/developer?id=Simplicity+Games";

	[HideInInspector]
	//public string ourGamesLink = string.Empty;

	[Space(10f)]
	//public string fbFanpageLink = "https://www.facebook.com/Simplicity-797558060363590?fref=ts";

	//public string fbFanpageApplication = "fb://page/797558060363590";

	[Space(10f)]
	//public string rateAppLink_iOS = string.Empty;

	//public string rateAppLink_Android = "https://play.google.com/store/apps/details?id=com.simplicity.slowomania";

//	[HideInInspector]
	//public string rateAppLink = string.Empty;
//
	// string imagesSourcesUrl = "http://static.simplicitygames.pl/stawiaj_na_miliony_sources.html";

	[Space(10f)]
	public bool rateAppPanelEnabled = true;

	public int rateAppPanelFirstAppearAfterLevel = 10;

	public int rateAppPanelShowFrequency = 10;

	public int showAdsFrequency = 2;

	public int showAdsFirstAppearAfterLevel = 3;

	public int buyNoAdsPanelFrequency;

	public int buyNoAdsPanelFirstApearAfterLevel;

	[Space(10f)]
	public bool ios;

	public bool showRateAppPanel;

	//public bool showBuyNoAdsPanel;

	public bool googlePlayLoggedIn;

	public bool serverLoggedIn;

	public SystemLanguage language;

	public BackManager backManager;

	public LiquidColorsDataManager liquidColorsDataManager;

	public ButtonsColorsDataManager buttonsColorsDataManager;

	public ProgressManager progressManager;

	[HideInInspector]
	public bool iapEnabled;

	public int watchedAdPrize;

	public int v4vcPrize = 3;

	public int interstitialPrize = 1;

	public int wonQuickGamePrize = 5;

	public int lostQuickGamePrize = 1;

	public bool isUserPrefenecesNetworkSync;

	public static Globals instance
	{
		get
		{
			return GetInstance();
		}
		private set
		{
			_instance = value;
		}
	}

	private static Globals GetInstance()
	{
		if (_instance == null)
		{
			FindOrCreateInstance();
		}
		return _instance;
	}

	private static void FindOrCreateInstance()
	{
		Globals globals = UnityEngine.Object.FindObjectOfType<Globals>();
		if (globals != null)
		{
			_instance = globals;
		}
		else
		{
			CreateNewGlobals();
		}
	}

	private static void CreateNewGlobals()
	{
		GameObject utilitiesGameObject = GetUtilitiesGameObject();
		Globals globals = _instance = utilitiesGameObject.AddComponent<Globals>();
	}

	private static GameObject GetUtilitiesGameObject()
	{
		GameObject gameObject = GameObject.Find("Utilities");
		if (gameObject == null)
		{
			gameObject = new GameObject("Utilities");
			UnityEngine.Object.DontDestroyOnLoad(gameObject);
		}
		return gameObject;
	}

	private void Awake()
	{

        InitializeGlobalsVariables();
	}

	private void InitializeGlobalsVariables()
	{
		InitializeDisplaySettings();
		Input.multiTouchEnabled = false;
		UnityEngine.Random.InitState(Environment.TickCount);
		//SetPlatformDependecies();
		backManager = base.gameObject.AddComponent<BackManager>();
		liquidColorsDataManager = new LiquidColorsDataManager();
		buttonsColorsDataManager = new ButtonsColorsDataManager();
		progressManager = new ProgressManager();
	}

	private void InitializeDisplaySettings()
	{
		//QualitySettings.vSyncCount = 0;
		//Application.targetFrameRate = 60;
		//Screen.sleepTimeout = -1;
	}
	 void Start()
	{

    }
    //private void SetPlatformDependecies()
    //{
    //	switch (Application.platform)
    //	{
    //	case RuntimePlatform.Android:
    //		//SetAndroidDependecies();
    //		break;
    //	case RuntimePlatform.IPhonePlayer:
    //		//SetIOSDependecies();
    //		break;
    //	default:
    //		//SetDefaultPlatformDependecies();
    //		break;
    //	}
    //}

    //private void SetAndroidDependecies()
    //{
    //	rateAppLink = rateAppLink_Android;
    //	ourGamesLink = ourGamesLink_Android;
    //	iapEnabled = true;
    //}

    //private void SetIOSDependecies()
    //{
    //	rateAppLink = rateAppLink_iOS;
    //	ourGamesLink = ourGamesLink_IOS;
    //	iapEnabled = true;
    //	ios = true;
    //}

    //private void SetDefaultPlatformDependecies()
    //{
    //	rateAppLink = string.Empty;
    //	ourGamesLink = string.Empty;
    //	iapEnabled = false;
    //}

    //public void OnRodoAccepted()
    //{
    //	UnityEngine.Debug.Log("On Rodo Accepted");
    //	CluifyManager.InitializeCluify();
    //	//GetComponent<AdsController>().InitializeAds();
    //}

    //public void OnRodoConsentWithhold()
    //{
    //	//GetComponent<AdsController>().Reconfigure(value: false);
    //}
}
